package com.specificgroup.jira.plugin.acpro.model;

import com.specificgroup.jira.plugin.acpro.model.acpro.AcproItemsPage;

/**
 * 
 * @author Ivan Holub
 */
public class PagingInfo {

    public static final Integer FIRST_PAGE = 1;

    private Integer numberOfItemsSelected;

    private Integer pageNumber = FIRST_PAGE;

    private Integer totalNumberOfItems;

    private Integer numberOfItemsOnPage;

    private Integer numberOfPages;

    private AcproItemsPage acproItemsPage;

    public AcproItemsPage getAcproItemsPage() {
        return acproItemsPage;
    }

    public void setAcproItemsPage(AcproItemsPage acproItemsPage) {
        this.acproItemsPage = acproItemsPage;
    }

    public Integer getNumberOfItemsSelected() {
        return numberOfItemsSelected;
    }

    public void setNumberOfItemsSelected(Integer numberOfItemsSelected) {
        this.numberOfItemsSelected = numberOfItemsSelected;
    }

    public Integer getPageNumber() {
        return pageNumber;
    }

    public void setPageNumber(Integer pageNumber) {
        this.pageNumber = pageNumber;
    }

    public Integer getTotalNumberOfItems() {
        return totalNumberOfItems;
    }

    public void setTotalNumberOfItems(Integer totalNumberOfItems) {
        this.totalNumberOfItems = totalNumberOfItems;
    }

    public Integer getNumberOfItemsOnPage() {
        return numberOfItemsOnPage;
    }

    public void setNumberOfItemsOnPage(Integer numberOfItemsOnPage) {
        this.numberOfItemsOnPage = numberOfItemsOnPage;
    }

    public Integer getNumberOfPages() {
        return numberOfPages;
    }

    public void setNumberOfPages(Integer numberOfPages) {
        this.numberOfPages = numberOfPages;
    }

    public boolean isPreviousPageEnabled() {
        return pageNumber != null && !FIRST_PAGE.equals(pageNumber);     
    }

    public boolean isNextPageEnabled() {
        return pageNumber != null && numberOfPages != null && !pageNumber.equals(numberOfPages);
    }

}
